// const path = require("path");
const webpack = require('webpack');

module.exports = {
    publicPath: process.env.NODE_ENV === 'production' ? 'https://cjlgb-design-oauth.cdn.bcebos.com/' : '/',
    css :   {
        loaderOptions: {
            less: {
                javascriptEnabled: true
            }
        }
    },
    configureWebpack :  {
        plugins: [
            //  忽略moment.js的所有区域设置文件
            new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
        ],
        // resolve: {
        //     alias: {
        //         //  图标按需加载
        //         '@ant-design/icons/lib/dist$': path.resolve(__dirname, './src/icons.js')
        //     }
        // }
    },
    //  跨域配置
    devServer : {
        //  关闭Host检查
        disableHostCheck : true,
        proxy: {
            '/apis' :   {
                target :    'http://cjlgb-design-gateway:10001',
                ws :    true,
                changeOrigin: true,
                pathRewrite :   {
                    '^/apis' :  ''
                }
            }
        }
    }
};
